<!doctype html>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
<head>
    <meta charset="utf-8">
    <title>Spring MVC Hibrnate Basics</title>

    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
    <link href="http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet">
</head>

<body>
    <div id="main" class="container">
        <div class="row">
           <c:if test="${!empty stock}">
                <h3>Stock ${stock.symbol}</h3>
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>Date</th>
                            <th>openPrice</th>
                            <th>highPrice</th>
                            <th>lowPrice</th>
                            <th>closePrice</th>
                            <th>volume</th>
                            <th>adjustedClosePrice</th>
                        </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${stockPriceDao}" var="stockPrice">
                        <tr>
                            <td>${stockPrice.priceDate}</td>
                            <td>${stockPrice.openPrice}</td>
                            <td>${stockPrice.highPrice}</td> 
                            <td>${stockPrice.lowPrice}</td> 
                            <td>${stockPrice.closePrice}</td> 
                            <td>${stockPrice.volume}</td> 
                            <td>${stockPrice.adjustedClosePrice}</td> 
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </c:if>
            <c:if test="${empty stock}">
                stock empty!
            </c:if>
        </div>
    </div><!-- id="main" -->
</body>
</html>